package com.mccrea.pattern.prototype.shallow;

/**
 * @author mccrea
 * @version 1.0
 * @description: 浅拷贝原型模式
 * @date 2021/5/7 23:32
 */
public class Client {
    public static void main(String[] args) {
        Sheep sheep = new Sheep("tom", 1, "内蒙古");
        try {
            Sheep sheep1 = (Sheep) sheep.clone();
            Sheep sheep2 = (Sheep) sheep.clone();
            Sheep sheep3 = (Sheep) sheep.clone();
            System.out.println(sheep1);
            System.out.println(sheep2);
            System.out.println(sheep3);
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
    }
}
